Skip to content

DOC: rephrase CoW ChainedAssignmentError message now CoW is always enabled #61970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

jorisvandenbossche
Copy link
Member

The "When using the Copy-on-Write mode" can be updated now it is no longer a mode that is enabled opt-in, but the only behaviour.

@jorisvandenbossche jorisvandenbossche added this to the 3.0 milestone Jul 27, 2025
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related, I noticed we use a ChainedAssignmentError with these messages to raise a warning, not an exception. Do you think we should change the name of this subclass to ChainedAssignmentWarning as a clearer name

@jorisvandenbossche
Copy link
Member Author

Related, I noticed we use a ChainedAssignmentError with these messages to raise a warning, not an exception. Do you think we should change the name of this subclass to ChainedAssignmentWarning as a clearer name

Yeah, it's probably confusing ..
So it was originally an exception (and was then called that way), but then we changed it to a warning because of some false positives that occurred in cython code (#51926). You asked the question at the time (#51926 (comment)), and so the idea is that it really is an error that you should fix (typically, except for those false positives if you are writing cython code), and that was the reasoning to prefer the "stronger" wording about an error. But of course a warning class being called Error is also confusing..

@mroeschke mroeschke merged commit d4ae649 into pandas-dev:main Jul 30, 2025
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants